﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;

namespace pygs.Messaging.Transport
{
    public abstract class WSCustomTransporter
    {
        public abstract bool IsAcceptedFor(Message message);
        public abstract bool Send(Message message);
    }

    public abstract class WSTransporter<T> : WSCustomTransporter where T : Message
    {
        public override bool IsAcceptedFor(Message message)
        {
            return (message is T);
        }

        protected abstract bool DoSend(T message);

        public override bool Send(Message message)
        {
            return DoSend(message as T);
        }
    }
}
